package ru.averta.notes.domain;

import ru.averta.notes.domain.abstr.AbstractPersistentObject;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;

@Entity
@Table(name = "Users")
public class User extends AbstractPersistentObject {

	public static final String DAO_F_MAIL = "mail";
	
	@Column(name = DAO_F_MAIL)
	private String mail;
	
	@Column(name = "PASSWORD")
	private String password;
	 
	//@Column(name = "IS_ADMIN")
	private boolean isAdmin;
	
	//@Column(name = "IS_ENABLED")
	@Transient
	private boolean isEnabled;

	public String getMail() {
		return mail;
	}

	public void setMail(String mail) {
		this.mail = mail.toLowerCase();
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public void setAdmin(boolean isAdmin) {
		this.isAdmin = isAdmin;
	}

	public boolean isAdmin() {
		return isAdmin;
	}

	public void setEnabled(boolean isEnabled) {
		this.isEnabled = isEnabled;
	}

	public boolean isEnabled() {
		return isEnabled;
	}

}
